package com.cq.hd.member.po;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.cq.hd.common.serialize.Decimal2Serializer;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * <p>
 * 用户积分明细
 * </p>
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("tb_user_points_detail")
@ApiModel(value = "TbUserPointsDetailPo对象", description = "用户积分明细")
public class TbUserPointsDetailPo implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "自增id")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @ApiModelProperty(value = "商家id")
    private Long businessId;

    @ApiModelProperty(value = "用户id")
    private Long userId;

    @ApiModelProperty(value = "收支类型：1收入 2支出")
    private Integer incomeType;

    @ApiModelProperty(value = "积分类型：1策划人调整积分 2消费积分 3转发积分 4订阅积分 5分销积分 6积分兑换 7积分订单退款")
    private Integer pointsType;

    @ApiModelProperty(value = "变动积分")
    @JsonSerialize(using = Decimal2Serializer.class)
    private BigDecimal beforePoints;

    @ApiModelProperty(value = "变动积分")
    @JsonSerialize(using = Decimal2Serializer.class)
    private BigDecimal points;

    @ApiModelProperty(value = "变动积分")
    @JsonSerialize(using = Decimal2Serializer.class)
    private BigDecimal afterPoints;

    @ApiModelProperty(value = "积分变更标题")
    private String title;

    @ApiModelProperty(value = "优惠券金额")
    @JsonSerialize(using = Decimal2Serializer.class)
    private BigDecimal couponAmount;

    @ApiModelProperty(value = "积分商品主图")
    private String productPic;

    @ApiModelProperty(value = "到账日期")
    private Integer daily;

    @ApiModelProperty(value = "关联记录id")
    private Long relationId;

    @ApiModelProperty(value = "积分订单id")
    private Long orderId;

    @ApiModelProperty(value = "创建时间")
    private LocalDateTime createTime;

    @ApiModelProperty(value = "更新时间")
    private LocalDateTime updateTime;
}
